package com.coldtech.circlecrash.units;

import com.coldtech.circlecrash.Player;
import com.coldtech.circlecrash.handler.UnitHandler;

public class MotherUnit extends Unit {
	private Player player = null;

	public MotherUnit(UnitHandler unitHandler, Player player, int x, int y) {
		super(unitHandler, player, x, y);
		this.player = player;
		setMother(true);
		setSize(50);
		setControlable(false);
	}

	public void action() {
		double rx = Math.sin(Math.random() * 360);
		double ry = Math.cos(Math.random() * 360);

		this.player.addUnit((int) (Math.round(this.getPosition().getX() + rx)),
				(int) (Math.round(this.getPosition().getY() + ry)));
	}
}
